/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package util;

import java.util.Date;

/**
 *
 * @author Administrator
 */
public class DateExtensions {

    public static long getDeltaMilliseconds(Date from, Date to) {
        return to.getTime() - from.getTime();
    }

    public static long getDeltaSeconds(Date from, Date to) {
        return getDeltaMilliseconds(from, to) / 1000;
    }

    public static long getDeltaMinutes(Date from, Date to) {
        return getDeltaSeconds(from, to) / 60;
    }

    public static long getDeltaHours(Date from, Date to) {
        return getDeltaMinutes(from, to) / 60;
    }

    public static long getDeltaDays(Date from, Date to) {
        return getDeltaMilliseconds(from, to) / 24;
    }
}
